import request from '@/utils/request'

export function login({orgId, username, password}) {
  return request({
    url: '/user/login/pwd', method: 'post', data: {
      org_id: orgId,
      username,
      password
    }
  })
}

export function userInfo({id} = {}) {
  return request({
    url: '/user/info', method: 'post',
    data: {
      id
    }
  })
}

export function changePwd({oldPwd, newPwd}) {
  return request({
    url: '/user/change/pwd', method: 'post', data: {
      old_pwd: oldPwd,
      new_pwd: newPwd
    }
  })
}

export function userList({loginName, type, limit, page}) {
  return request({
    url: '/user/list', method: 'post',
    data: {
      login_name: loginName,
      type,
      limit,
      page
    }
  })
}
